enum Size
{
    Small,
    Medium,
    Big
}

interface IFastFoodBuilder
{
      buildBuger(name:string,option:object):IFastFoodBuilder;
      buildFires(size:Size,option:object):IFastFoodBuilder;
      buildCola(size:Size,option:object):IFastFoodBuilder;
      getMeal():FastFood;
}
class FastFood
{
  private _buger:object;
  private _fires:object;
  private _cola:object;

  constructor(buger:object={},fires:object={},cola:object={})
  {
    this._buger = buger;
    this._fires = fires;
    this._cola = cola;
  }

  public get buger():object
  {
      return this._buger;
  }

  public get fires():object
  {
      return this._fires;
  }

  public get cola():object
  {
      return this._cola;
  }
}
class Mcdonalds implements IFastFoodBuilder
{
    buildBuger(name: string, option: object): IFastFoodBuilder {
       this._meal['buger'] = 
       {
         type:"burger",name,option
       };
       return this;
    }
    buildFires(size: Size, option: object): IFastFoodBuilder {
       this._meal["fires"] = {
         type:"fires",
         size,option,
       };
       return this;
    }
    buildCola(size: Size, option: object): IFastFoodBuilder {
      this._meal["cola"] = {
        type : "cola",
        size,option
      };
      return this;
    }
    private _meal: object = {};

    constructor(Option)
    {
        console.log("basic info");
    }
    getMeal():FastFood
    {
        const meal:FastFood = new FastFood(this._meal["buger"],this._meal["fires"],this._meal["cola"]);
        return meal;
    }
}
export class BuilderAction
{
    test()
    {
        const mcd:Mcdonalds = new Mcdonalds({ location: 'Zhujiang New Town, Canton, China' });
        const fastfood:FastFood = mcd.buildBuger("big mac",{sacult:false}).buildFires(Size.Medium,{ice:false}).buildCola(Size.Big,{"sauct-amount":2}).getMeal();
        console.log(fastfood);

    }
}